package com.hermit.qmst.tools;

import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

/**
 * Created by hermithermit on 15/2/16.
 */
public class Common {

    public static String myPhone;
    public static String myPassword;
    public static  boolean isShowRegister=false;
    public static  boolean isShowSmsVerification=false;
    //  测试120.76.230.248
    //120.76.230.248
//    public static String mUrl = "http://120.76.230.248/";
//    public static String mIP = "120.76.230.248";
    // 正式  120.76.191.63
    public static String mUrl = "http://120.76.191.63/";
    public static String mIP = "120.76.191.63";
    public static String mCommUrl="http://120.76.191.63/net/./uploads/";

    public static String mSipPort = "5189";
    public static String mSipAccout;
    public static long mSipAccountId;
    public static String mCallPhone;
    public static String mUserId;
    public static String mCallName;
    public static String mCallAera;
    public static boolean mShowAutoAnswer;//打电话时才启动自动接听
    public static boolean mIsAutoAnswer;//自动接听设置
    public static String mApkName = "kxl.apk";
    public static String mAgentId = "1160";   //代理商Id
    public static String mAgentName = "";   //代理商Name
    public static String mAgentThirdId = "";  //三级代理商Id
    public static String mVersionCode = "10";
    public static int mHeightPixels;//屏幕高度 f
    public static int mWidthPixels;//屏幕宽度
    public static String mTxtFileName = "info";//拨打界面广告文件
    public static String mCommendTxtFileName = "commend_info";//精品推荐文件
    public static String mProductTxtFileName = "product_info";//产品列表文件
    public static String mCallWaitTxtFileName = "callwait_info";//拨号等待文件
    public static String mSysMessageTxtFileName = "sys_info";//拨号等待文件
    public static String mWebsiteTxtFileName = "website_info"; //官网
    public static String mFindTxtFileName = "find_info"; //

    public static String mRootDirPath;
    public static String mDialImagePath = "/image/dial/";//所有存图片存放目录
    public static String mInfoId = "10";//获取广告信息
    public static int indexCount = 10; //条数
//    //短信key  全名商通
//    public static String smsKey = "1777be3e70400";
//    //短信api 全名商通
//    public static String smsSecrer = "e73f61c0fc9d75635b5814d97deebcce";
    //短信key
//    public static String smsKey = "17ab45f2abd90";
//    //短信api
//    public static String smsSecrer = "6c7ed51482e456b594f904e120f24d61";

    public static String getDialImageDirPath() {
        return mRootDirPath + mDialImagePath;
    }

    //打电话
    public static String submitCallPath() {
        return mUrl + "/szdh/subcalltask.php?";
    }

    //登录
    public static String submitLoginPath() {
        return mUrl + "/szdh/userlogin.php?";
    }

    //充值路径
    public static String submitRechargPath() {
        return mUrl + "/szdh/recharge.php?";
    }

    //卡密注册路径
    public static String submitRechargCarRegisterPath() {
        return mUrl + "/call.php?";
    }

    //免费注册路径
    public static String submitFreeRegisterPath() {
        return mUrl + "/szdh/userregister.php?";
    }

    //修改密码路径
    public static String submitChangePasswordPath() {
        return mUrl + "/szdh/editpassword.php?";
    }

    //查询余额路径
    public static String submitQueryBalancePath() {
        return mUrl + "/szdh/queryaccount.php?";
    }

    public static String submitQueryMoreInfoPath() {
        return mUrl + "/szdh/more_info.php?";
    }

    //签到
    public static String submitSignPath() {
        return mUrl + "/szdh/signgetfee.php?";
    }
    //首页图片

    public static String submitQueryPicPath() {
        return mUrl + "/szdh/pic.php?";
    }

    //首页文字
    public static String submitQueryTextPath() {
        return mUrl + "/szdh/text.php?";
    }

    //消息列表
    public static String submitMessageList() {
        return mUrl + "/szdh/message.php?type=query&count=" + indexCount;
    }

    //阅读消息
    public static String submitReaderMessage() {
        return mUrl + "/szdh/praise.php?";
    }

    //消息总数
    public static String submitMessageCount() {
        return mUrl + "/szdh/message.php?type=read";
    }
    // 企业动态接口
    public static  String submitAuthority(){
        return mUrl+"/szdh/discovery/agentMessages.php?agentId=";
    }
    //更新版本
    public static String submitUpdatePath() {
//        http://120.76.191.63/wap/update.php?version=1&agent_id=2
        return "http://120.76.191.63/wap/update.php?version=";
//        return "http://voip818.com/download.php?agent_id=" + mAgentId + "&type=android&code=" + mVersionCode;
    }

    //商家
    public static String businessList() {
        return mUrl + "szdh/discovery/business.php?agentId=";
    }

    //发现
    public static String submitDiscovery() {
        return mUrl + "/szdh/discovery/find.php";
    }
    //获取音频
    public static String getMusic(){
        return mUrl+"/szdh/music.php?action=getCurrentVoice&agent_id=";
    }
    public static boolean checkWIFI(Context pContext) {
        WifiManager wifiManager = (WifiManager) pContext.getSystemService(Context.WIFI_SERVICE);
        WifiInfo wifiInfo = wifiManager.getConnectionInfo();
        int ipAddress = wifiInfo == null ? 0 : wifiInfo.getIpAddress();
        if (wifiManager.isWifiEnabled() && ipAddress != 0) {
            return true;
        } else {
            return false;
        }
    }
}
